Skip to content

Conversation

@williexu
Copy link
Contributor

@williexu williexu commented Jun 22, 2018


Added testing for spellchecker and msg choice

Fixes: #6562

@williexu williexu requested a review from tjprescott June 22, 2018 01:13
@codecov-io
Copy link

codecov-io commented Jun 22, 2018

Codecov Report

Merging #6636 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##           dev   #6636   +/-   ##
===================================
  Coverage    0%      0%           
===================================
  Files       11      11           
  Lines      145     145           
  Branches    11      11           
===================================
  Misses     145     145

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 741ffd8...f43b034. Read the comment docs.

@williexu williexu added this to the Sprint 40 milestone Jun 22, 2018
value=value)
if not self.command_source:
# parser has no `command_source`, value is part of command itself
error_msg = "{prog}: '{value}' is not in the '{prog}' command-group. See '{prog} --help'.".format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to hyphenate command group.

@troydai
Copy link
Contributor

troydai commented Jun 25, 2018

Can we add a test for this?

telemetry.set_user_fault(error_msg)
logger.error(error_msg)
candidates = difflib.get_close_matches(value, action.choices, cutoff=0.8)
candidates = difflib.get_close_matches(value, action.choices, cutoff=0.7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale behind this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt it a little too strict; 0.8 allows zero edits for words under 5 letters; and at most 1 edit until words of length 10 or more.
0.7 allows a edit for four-character words and 2 edits for words of length 7, 8, and 9.

This isn't the main purpose of this PR, however, and I can change this back if you guys prefer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with it--just wanted to know the reason.

@williexu williexu modified the milestones: Sprint 40, Sprint 41 Jun 25, 2018
@williexu
Copy link
Contributor Author

@troydai I'll look into adding a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants